package ru.arriah.servicedesk.web.commonaction;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ru.arriah.common.web.action.ActionMapping;
import ru.arriah.common.web.action.DumbAction;
import ru.arriah.servicedesk.web.commonaction.exception.LoginException;


public class ExitAction extends DumbAction {
   
  public ExitAction() {
      super();
   }
  
   public String execute(
      ActionMapping actionMapping,
      HttpServletRequest request,
      HttpServletResponse response
   ) throws IOException, ServletException {
      String alias = 
         (String)request.getSession().getAttribute("alias");
      request.getSession().invalidate();
      request.getSession().setAttribute("alias", alias);
      throw new LoginException("ErrorMessage.relogin");
   }
}